const {defineConfig} = require('@vue/cli-service')
const {VueLoaderPlugin} = require('vue-loader');
module.exports = defineConfig({
    transpileDependencies: true,
    configureWebpack: {
        resolve: {
            extensions: [".ts", ".tsx", ".js", ".json"]
            , preferRelative: true,
        },
        plugins: [
            new VueLoaderPlugin()
        ],
        module: {
            rules: [
                {
                    test: /\.tsx?$/,
                    loader: 'ts-loader',
                    exclude: /node_modules/,
                    options: {
                        appendTsSuffixTo: [/\.vue$/],
                        transpileOnly: true
                    }

                }
            ]
        }
    },
    pages: {
        index: {
            entry: 'src/main.js',
            template: 'public/index.html',
            filename: 'index.html',
            chunks: ['chunk-vendors', 'chunk-common', 'index']
        },
        admin: {
            entry: 'src/main.js',
            template: 'public/admin/admin.html',
            filename: 'admin/admin.html',
            chunks: ['chunk-vendors', 'chunk-common', 'admin']
        }
    }
})
